package com.gryffonx.Interfaces.dice;

import com.gryffonx.utils.StringUtils;

import javax.swing.*;
import java.awt.*;


/**
 * @author Erik Stell
 * @version 1.0
 */
public class DiceRollerGUI extends JFrame {
    /**
     * @param title
     * @throws HeadlessException
     */
    public DiceRollerGUI(String title) throws HeadlessException {
        super(title);
        setResizable(false);
        setLocation(((Toolkit.getDefaultToolkit().getScreenSize().width / 2) -
                (getWidth() / 2)),
                ((Toolkit.getDefaultToolkit().getScreenSize().height / 2) -
                        (getHeight() / 2)));

        DiceRoller thisPanel = new DiceRoller(title);
        this.setContentPane(thisPanel.getMainPanel());

        ImageIcon appIcon = StringUtils.createImageIcon("/images/diceIcon2.gif");
        this.setIconImage(appIcon.getImage());
    }

    public static void main(String[] args) {

        //get the label input from the modal window
        String panelValue = "Dice Roller2";
        DiceRollerGUI window = new DiceRollerGUI(panelValue);
        window.pack();
        window.setVisible(true);
    }
}
